package Swing;
/*
*复选框按钮
 */
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;

public class JButton_Demo03 extends JFrame {
    public JButton_Demo03() throws IOException {
        Container contentPane = this.getContentPane();
        //将一个图片变成图标
//        URL resource =  JButton_Demo.class.getResource("jetbrains://idea/navigate/reference?project=untitled&path=1.PNG");

        ImageIcon imageIcon = new ImageIcon(ImageIO.read(new File("src/1.PNG")));
        //复选框按钮
        JCheckBox checkBox1 = new JCheckBox("checkBox1");
        JCheckBox checkBox2 = new JCheckBox("checkBox2");
        JCheckBox checkBox3 = new JCheckBox("checkBox3");
        contentPane.add(checkBox1,BorderLayout.NORTH);
        contentPane.add(checkBox2,BorderLayout.CENTER);
        contentPane.add(checkBox3,BorderLayout.SOUTH);
        this.setVisible(true);
        this.setSize(500,500);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
 
    }

    public static void main(String[] args) throws IOException {
        new JButton_Demo03();
    }
}
